﻿<link href="~/Plugin/plupload2/jquery.plupload.queue/css/jquery.plupload.queue.css" rel="stylesheet" />
<script src="~/Scripts/jquery-3.2.0.min.js"></script>
<script src="~/Plugin/plupload2/plupload.full.min.js"></script>
<script src="~/Plugin/plupload2/jquery.plupload.queue/jquery.plupload.queue.min.js"></script>

<fieldset>
    <legend>拆分图片上传</legend>
    <div id="html5_uploader">Error.</div>
</fieldset>

<fieldset>
    <legend>不拆分图片上传</legend>
    <div id="html5_uploader2">Error.</div>
</fieldset>

<script>
    /*
    * 拆分式图片上传
    */
    $("#html5_uploader").pluploadQueue({
        runtimes: 'html5',
        url: "/File/Uploader",
        unique_names: true,
        multi_selection: true,
        chunk_size: "1mb",
        filters: {
            mime_types: [{ title: "Image files", extensions: "jpg,gif,png" }],
        },
        init: {
            UploadComplete: function (uploader, files) {
                $(".plupload_upload_status").hide();
                //继续显示文件上传按钮
                $(".plupload_buttons").show();
                // 使文件上传的按钮有效
                uploader.disableBrowse(false);
            },
        },
    });

    /*
    * 非拆分式图片上传
    */
    $("#html5_uploader2").pluploadQueue({
        runtimes: 'html5',
        url: "/File/UploaderWIthNoChunk",
        unique_names: true,
        multi_selection: true,
        chunk_size: "0",
        filters: {
            mime_types: [{ title: "Image files", extensions: "jpg,gif,png" }],
        },
        init: {
            UploadComplete: function (uploader, files) {
                $(".plupload_upload_status").hide();
                //继续显示文件上传按钮
                $(".plupload_buttons").show();
                // 使文件上传的按钮有效
                uploader.disableBrowse(false);
            },
        },
    });
</script>